The Unofficial LEGO MINDSTORMS NXT 2.0 Inventor's Guide by David J. Perdue

The Unofficial LEGO MINDSTORMS NXT 2.0 Inventor's Guide by David J. Perdue

Author:David J. Perdue [David J. Perdue and Laurens Valk]
Language: eng
Format: epub
Tags: TECHNOLOGY & ENGINEERING / Robotics
ISBN: 9781593273064
Publisher: No Starch Press
Published: 2012-09-13T00:00:00+00:00


Figure 8-30. The Math block

The Math block’s configuration panel has only the Operation parameter (Figure 8-31). The drop-down menu enables you to select the operation you want. If you’re not going to supply the input values A or B through data wires, you can type values in the A and B text boxes.

Figure 8-31. The Math block’s configuration panel

In Figure 8-32 a program uses an Ultrasonic Sensor block to send the readings of an ultrasonic sensor to a Math block, which multiplies the number data by two (specified in its configuration panel). The Math block’s output then goes to the Power plug on a Motor block. Therefore, the motor’s power will always be double what the ultrasonic sensor reads. For instance, if the ultrasonic sensor reads 40 inches, then the Motor block’s Power parameter would be 80 percent.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.